package com.yao.mall.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yao.mall.model.dto.shoppingOrder.GoodsSkuOrderRequest;
import com.yao.mall.model.dto.shoppingOrder.OrderCreateRequest;
import com.yao.mall.model.dto.shoppingOrder.OrderQueryRequest;
import com.yao.mall.model.entity.ShoppingOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yao.mall.model.vo.CreateOrderVO;
import com.yao.mall.model.vo.WeekOrderCountVO;
import com.yao.mall.model.vo.perOrder.PreOrderOfCartVO;
import com.yao.mall.model.vo.ShoppingOrderVO;
import com.yao.mall.model.vo.perOrder.PreOrderOfGoodsSkuVO;

import java.util.List;

/**
* @author jiahua.yao
* @description 针对表【shopping_order】的数据库操作Service
* @date 2024-03-26 19:31:16
*/
public interface ShoppingOrderService extends IService<ShoppingOrder> {

    /**
     * 购物车页面下单
     * @return preShoppingOrder
     */
    PreOrderOfCartVO preOrderOfCart();

    /**
     * 创建订单
     * @return CreateOrderVO
     */
    CreateOrderVO createOrder(OrderCreateRequest orderCreateRequest);

    /**
     * 根据id获取订单详情
     * @param id 订单id
     * @return ShoppingOrderVO
     */
    ShoppingOrderVO orderDetail(Long id);

    /**
     * 获取不同状态下的订单信息
     * @param orderCreateRequest 订单状态dto
     * @return Page<ShoppingOrderVO>
     */
    Page<ShoppingOrderVO> getOrderByStatus(OrderQueryRequest orderCreateRequest);

    /**
     * 商品详情页直接创建预订单
     * @param preOrderRequest 订单request
     * @return PreOrderOfGoodsSkuVO
     */
    PreOrderOfGoodsSkuVO preOrderOfGoodsSku(GoodsSkuOrderRequest preOrderRequest);

    /**
     * 获取未付款订单
     * @return
     */
    Long getObligationOrder();

    /**
     * 获取待发货订单
     * @return
     */
    Long getDeliverOrder();

    /**
     * 获取订单总数
     * @return
     */
    Long getSumOrder();

    /**
     * 获取当日订单数
     * @return
     */
    Long getDayOrder();

    /**
     * 一周内订单数统计
     * @return
     */
    List<WeekOrderCountVO> getWeekOrder();

    /**
     * 发货接口
     * @param orderId
     * @return
     */
    Boolean toSendGoods(Long orderId);

    /**
     * 订单收货
     * @param orderId
     * @return
     */
    Boolean toGetOrder(Long orderId);
}
